﻿//using AutoMapper;
//using HamcoWcs.Contract.ContractCommon;
//using HamcoWcs.Contract.ContractMes;
//using HamcoWcs.DAL;
//using HamcoWcs.Entitys.MainTasks;
//using HamcoWcs.Entitys.MesMsgQueues;
//using HamcoWcs.Models.Common.Enums;
//using HamcoWcs.Models.MainTasks;
//using HamcoWcs.Models.TibcoMessage;
//using HamcoWcs.Service.Common;
//using System;
//using System.Xml;

//namespace HamcoWcs.Service.Mes.Parsers
//{
//    /// <summary>
//    /// （弃用）
//    /// </summary>
//    public class MesMsgParser_MachineModeChangeByMESRequest : MesMsgParserBase
//    {

//        public MesMsgParser_MachineModeChangeByMESRequest(ILoggerService loggerService, WcsDbContext wcsDbContext, IMapper mapper)
//            : base(loggerService, wcsDbContext, mapper)
//        {
//        }


//        public string EventName => "MACHINEMODECHANGEBYMESREQUEST";


//        public void HandleEvent(MesMsgQueue message)
//        {
//            throw new NotImplementedException();
//            string xml = message.Content;
//            try
//            {
//                var jobMessage = XmlHelper.Deserialize<PalletRequestTransportJobMessage>(xml);

//                var res = XmlHelper.SetJobReply(xml);
//                // 简单判断是否可以生成指令
//                if (jobMessage.Body.DestinationZoneName == jobMessage.Body.SourceZoneName)
//                {
//                    res = XmlHelper.SetNGReturn(res, "1", "The start zone and end zone of the creation task cannot be the same");
//                    message.Return = res;
//                    message.Status = (int)EnumMesMsgStatus.WcsExcuted;
//                    return;
//                }

//                message.Status = (int)EnumMesMsgStatus.MesWait;
//                res = XmlHelper.SetXmlNodeText(res, "REPLYSUBJECTNAME", TibcoConfiguration.BasicConfiguration.RecvSubject);

//                //CreateTask(jobMessage);
//                _wcsDbContext.SaveChanges();
//            }
//            catch (Exception ex)
//            {
//                message.Status = (int)EnumMesMsgStatus.Error;
//                AddSystemErrorLog(xml, ex);
//            }

//        }


//    }
//}
